package com.jiaai.shop.store.mapper;

import com.jiaai.shop.store.entity.SUser;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
  * 后台管理员表 Mapper 接口
 * </p>
 *
 * @author
 * @since 2018-04-01
 */
@Mapper
public interface SUserMapper extends BaseMapper<SUser> {

    /**
     * 利用用户id来搜索密码
     * */
    @Select("SELECT t1.`password` \n" +
            "FROM s_user t1 \n" +
            "WHERE t1.`user`=#{mId}")
    String login(@Param("mId") String mId);
    /**
     * 利用用户id来搜索用户名
     * */
    @Select("SELECT t1.userName\n" +
            "FROM s_user t1 \n" +
            "WHERE t1.`user`=#{mId}")
    String userName(@Param("mId") String mId);
    /**
     * 利用用户id来搜索用户名
     * */
    @Select("SELECT t1.*\n" +
            "FROM s_user t1 \n" +
            "WHERE t1.`user`=#{mId}")
    SUser userAll(@Param("mId") String mId);
}